import { createRouter, createWebHashHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import LoginView from '../views/loginView.vue'

const routes = [
  {
    path: '/Home',
    name: 'Home',
    meta: {
      isShow: false,
      title: '主页'
    },
    children: [
      {
        path: '/courseList',
        name: 'CourseList',
        meta: {
          isShow: true,
          title: '任务列表'
        },
        component: () => import('../views/courseList.vue')
      },
      {
        path: '/teacherList',
        name: 'TeacherList',
        meta: {
          isShow: true,
          title: '接口列表'
        },
        component: () => import('../views/teacherList.vue')
      },
      {
        path: '/userMg',
        name: 'UserMg',
        meta: {
          isShow: true,
          title: '用户管理'
        },
        component: () => import('../views/userMg.vue')
      }
    ],
    component: HomeView
  },

  {
    path: '/',
    name: 'Login',
    meta: {
      isShow: false,
      title: '登陆'
    },
    component: LoginView
    // component: () => import(/* webpackChunkName: "login" */ '../views/loginView.vue')
  }


  // {
  //   path: '/personal',
  //   name: 'Personal',
  //   component: () => import(/* webpackChunkName: "login" */ '../views/personal.vue')
  // }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
